<?php
/**
+--------------------------------------------------------------
 * User: maqun
+--------------------------------------------------------------
 * Date: 2015/12/16
+--------------------------------------------------------------
 * Time: 9:58
+--------------------------------------------------------------
 * DiscuzModel 处理用户登录
+--------------------------------------------------------------
 */
class DiscuzModel extends BaseModel{

    protected $tableName = "uc_members";//数据库表名

    public function checkLogin($user_id,$pass){

        $return = false;
        $sql="select password,salt,username from uc_members where username='{$user_id}'";
        $res = $this->db(1,C('DB_CONFIG_1'))->query($sql);
        if(!empty($res)){
            if($res[0]['password']==md5(md5($pass).$row[0]['salt'])){
                $return = $row[0]['username'];
            }
        }
        return $return;
    }
}